package com.cellngine.client;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;

public class Layer
{
	short		attrib;
	List<Tile>	tiles;
	
	Layer()
	{
		tiles = new Vector<Tile>();
	}
	
	public int addTile(final short texture, final short gridx, final short gridy)
	{
		final Tile t = new Tile();
		t.setTexture(texture);
		t.setPosition(gridx, gridy);
		tiles.add(t);
		return tiles.indexOf(t);
	}
	
	public void addNullTile()
	{
		tiles.add(null);
	}
	
	public void draw()
	{
		for (short i = 0; i < tiles.size(); i++)
		{
			if (tiles.get(i) != null)
			{
				tiles.get(i).draw();
			}
		}
	}
	
	public int getSize()
	{
		return tiles.size();
	}
}
